<template>
  <el-dialog
    v-model="props.openModal"
    title="客户修改日志"
    @close="emit('close')"
  >
    <div class="h-[70vh] overflow-y-scroll overflow-x-hidden">
      <el-row
        :gutter="10"
        class="mt-6 relative"
        v-for="(item, index) in logList"
        :key="index"
      >
        <el-col :span="2" class="text-center">
          <el-avatar
            src="https://cube.elemecdn.com/0/88/03b0d39583f48206768a7534e55bcpng.png"
          />
          <div>{{ item.customerName }}</div>
        </el-col>
        <el-col :span="22">
          <div class="text-gray-700 text-[16px] font-bold">
            {{ item.modificationDetails }}
          </div>
          <div class="flex items-center my-1">
            <UserFilled size="4" class="mr-1" />
            <div class="text-gray-500 text-sm">
              {{ item.modificationRemark }}
            </div>
          </div>
          <div class="text-xs mt-1">
            {{ item.modificationDate }}
          </div>
        </el-col>
      </el-row>
    </div>
    <template #footer>
      <div class="dialog-footer">
        <el-button @click="emit('close')">取消</el-button>
        <el-button type="primary" @click="handleAddrEdit"> 确定 </el-button>
      </div>
    </template>
  </el-dialog>
</template>

<script setup>
import { ElMessage, ElMessageBox } from "element-plus";
import { ref } from "vue";
import { cityOptions } from "../../../../../utils/city";
const props = defineProps({
  openModal: {
    type: Boolean,
    default: false,
  },
});
const logList = [
  {
    id: 1,
    customerName: "李四",
    modificationDate: "2025-01-10 09:30:00",
    modificationDetails:
      "将产品“实木门A01”的尺寸从2000mm×800mm修改为2050mm×800mm",
    modificationRemark: "根据客户定制要求调整尺寸，以满足特殊空间需求。",
  },
  {
    id: 2,
    customerName: "王五",
    modificationDate: "2025-01-10 11:15:00",
    modificationDetails:
      "更新产品“钢质防火门B02”的原材料供应商信息，从“华强钢铁”改为“中泰钢铁”",
    modificationRemark:
      "原供应商华强钢铁因产能不足无法按时供货，紧急更换为中泰钢铁以保证生产进度。",
  },
  {
    id: 3,
    customerName: "赵六",
    modificationDate: "2025-01-10 14:45:00",
    modificationDetails:
      "调整产品“铝制推拉门C03”的生产成本核算，材料成本从300元/扇调整为320元/扇",
    modificationRemark:
      "由于铝材市场价格波动，重新核算材料成本，确保成本数据准确。",
  },
  {
    id: 4,
    customerName: "周七",
    modificationDate: "2025-01-10 16:20:00",
    modificationDetails: "为产品“复合门D04”新增一个颜色选项“深棕色”",
    modificationRemark:
      "根据市场调研结果，深棕色需求增长，新增颜色选项以拓展产品线。",
  },
  {
    id: 5,
    customerName: "吴八",
    modificationDate: "2025-01-10 17:50:00",
    modificationDetails:
      "修正产品“玻璃门E05”的产品描述，将“采用普通玻璃”改为“采用钢化玻璃”",
    modificationRemark:
      "产品升级，使用更安全的钢化玻璃替代普通玻璃，提升产品竞争力。",
  },
];
const emit = defineEmits(["close"]);

function handleAddrEdit() {
  editForm.value.address = editForm.value.address.join(",");
}
</script>